<template>
  <div>
    <ul>
      <li @click="selectItem(song,index)" v-for="(song,index) in songs" class="item" :key="song.id">
        <div class="content">
          <h2 class="name">{{song.name}}</h2>
          <p class="desc">{{song.singer}}.{{song.album}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
  export default{
    props:{
      songs:{
        type:Array,
        default:() => {
          return []
        }
      }
    },
    methods:{
      selectItem(song,index){
        this.$emit('select',song,index)
      }
    }
  }
</script>

<style lang="stylus" scoped>
@import '~common/stylus/variable';
  .item
    height 64px
    display flex
    align-items center
    font-size $font-size-medium
    // padding-left 30px
    .name
      color $color-text
    .desc
      margin-top 10px
      color $color-text-d
</style>

